import {api, operation, param, requestBody} from '@loopback/rest';<%if (withImplementation) { %>
import {inject} from '@loopback/core';

import {<%- serviceClassName %>} from '../services';
  <% } %>
<%_
imports.forEach(i => {
-%>
<%- i %>
<%_
});
-%>

/**
 * The controller class is generated from OpenAPI spec with operations tagged
 * by <%- tag || '<no-tag>' %>.
 *
<%_ const _comment = escapeComment(description);
    if (_comment) {
-%>
 * <%- _comment %>
<%_ } -%>
 */
<%- decoration %>
export class <%- className %> {<% if(withImplementation){ %>
    constructor(@inject('services.<%- serviceClassName %>')
    protected <%- serviceClassNameCamelCase %>: <%- serviceClassName %>) {}
  <% } else { %>
    constructor() {} <% } %>
  <%_ for (const m of methods) { -%>
  /**
  <%_ for (const c of m.comments) {
        const _comment = escapeComment(c);
        if (_comment) {
  -%>
   * <%- _comment %>
  <%_   } else { -%>
   *
  <%_   }
    } -%>
   */
  <%- m.decoration %>
  <%- m.signature %> {
    <% if(withImplementation){ %> <%- m.implementation %> <% } else{ %> throw new Error('Not implemented'); <% } %>
  }
  <%_ } -%>
}

